package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Applyer;
import cn.wolfcode.crm.mapper.ApplyerMapper;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IApplyerService;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class ApplyerServiceImpl implements IApplyerService{

    @Autowired
    private ApplyerMapper mapper;

    public void deleteByPrimaryKey(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public void insert(Applyer record) {
        mapper.insert(record);
    }

    public PageResult query(QueryObject qo) {
        int total = mapper.query4Count(qo);
        if(total > 0){
            return new PageResult(total,mapper.query4List(qo));
        }
        return new PageResult(total, Collections.EMPTY_LIST);
    }

    public List<Applyer> selectAll() {
        return null;
    }

    public void updateByPrimaryKey(Applyer record) {
        mapper.updateByPrimaryKey(record);
    }
}
